home *** CD-ROM | disk | FTP | other *** search
- Path: grafix.xs4all.nl!john.hendrikx
- Date: Wed, 24 Jan 96 20:42:38 GMT+1
- Newsgroups: comp.sys.amiga.programmer
- Distribution: world
- Subject: Re: Demo/game to OS friendly part II
- MIME-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: 8bit
- From: john.hendrikx@grafix.xs4all.nl (John Hendrikx)
- Message-ID: <john.hendrikx.48xr@grafix.xs4all.nl>
- Organization: Grafix Attack BBS Holland
-
- In a message of 23 Jan 96 Mjp3783@alpha.isc.rit.e wrote to all:
-
- Mai> All of these "discussions" of OS functionality remind me of a
- Mai> conversation that happened here a long time ago. A group of asm
- Mai> programmers were discussing the fastest way to copy memory from one
- Mai> location to another. After 2-3 weeks, they finally had a piece of code
- Mai> for everyone to see. (For those interested, it moved all of the
- Mai> registers to the stack, copied 14-15 registers at a time, then replaced
- Mai> the stack and all of its variables)
-
- That's interesting, on my setup however the Movem loop is not the fastest way
- to copy (but that's not the issue). The most interesting result from my test
- however was that turning off DataCache on my 68030/22 had a dramatic increase
- in copying performance:
-
- Testresults - Mar 21 1995
-
- Using a Movem-loop 200990 bytes/frame (PAL machine, 12 registers used,
- unrolled 3 times)
- (9.58 MB/sec, AIBB tells me 9.5-9.8 MB/sec)
-
- Using a 48 times unrolled Move.l-loop 212353 bytes/frame
- (10.1 MB/sec)
-
- Now with datacache off (!):
-
- Using a 48 times unrolled Move.l-loop 242323 bytes/frame
- (11.6 MB/sec)
-
- The Movem loop wasn't the most optimized version possible, but I doubt it would
- have made much difference.
-
- (All tests done on a 68030/22 MHz, 60ns 32-bit FastRAM. Source and destination
- were not overlapping. During tests interrupts and all DMA was disabled)
-
- Can anybody explain what is happening with the DataCaching? According to my
- tests ChipRAM access also becomes faster with DataCache off.
-
- Mai> Mike Sinz (I think - maybe Radell
- Mai> Jessup) replied to the message and stated that that was almost
- Mai> instruction for instruction what the OS does. You can take this one of
- Mai> two ways:
-
- Then why is there this CopyMemQuicker patch if the OS already uses the
- "fastest" way of copying?
-
- Mai> 1) K0derz are as smart as the OS designers and don't need an OS,
- Mai> anyway
-
- It would be silly to assume that there is no-one out there who can program
- ASM/C whatever better than the OS-designers.
-
- It also depends on how much time you want to spend on such a subject as
- whatever you come up with you'll find that the ideal solution depends on the
- processor. On 68000's it would be safe to assume a Movem loop is faster as it
- requires much less instruction fetches. On 68030 and up instruction-fetches
- are of little importance as they can be in the cache.
-
- Mai> 2) OS designers have some vague clue what optimization is, might be
- Mai> doing something right and don't need a bunch of snot nosed brats who
- Mai> can't deal with any rules to tell them that they don't know the jobs
- Mai> they are being well compensated for.
-
- They often haven't got the time to bother with silly issues like how to copy
- mem fastest, so if they don't always come up with the fastest results then they
- must have considered it unimportant or of no great impact to overall system
- speed.
-
- Grtz John
-
- -----------------------------------------------------------------------
- John.Hendrikx@grafix.xs4all.nl TextDemo/FastView/Etc... development
- -----------------------------------------------------------------------
- -- Via Xenolink 1.985B3, XenolinkUUCP 1.1
-